package org.example.demo14;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;

public class Demo14 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream buf1=new BufferedInputStream(new FileInputStream(new File("C:/out/a.txt")));
        byte[] aaa=new byte[buf1.available()];
        buf1.read(aaa);
        BufferedInputStream buf2=new BufferedInputStream(new FileInputStream(new File("C:/out/b.txt")));
        byte[] bbb=new byte[buf2.available()];
        buf2.read(bbb);
        PrintWriter pw=new PrintWriter("C:/out/c.txt");
        pw.write(new String(aaa)+new String(bbb));
        System.out.println("操作完成");
        buf1.close();
        buf2.close();
        pw.close();
    }
}
